package File;

import java.io.File;
import java.io.IOException;

public class Demo1 {
    public static void main(String[] args) throws IOException {
        //File file=new File("D:\\C++\\gitee\\java-learning\\java-learning\\text.txt");
        File file=new File("./text.txt");
        System.out.println(file.getParent());
        System.out.println(file.getName());
        System.out.println(file.getPath());
        System.out.println(file.getAbsoluteFile());//绝对路径
        System.out.println(file.getCanonicalPath());//绝对路径简化
    }
}
